#include "midi_player.h"

#include <QProcess>

MidiPlayer::MidiPlayer(QObject *parent):
  QObject(parent) {
  timidity = new QProcess(this);
  connect(timidity, SIGNAL(finished(int, QProcess::ExitStatus)),
          this, SIGNAL(finished()));
}

/*!
 * Lance la lecture du fichier MIDI
 */
void MidiPlayer::play() {
  timidity->start("timidity tmp.midi");
}

/*!
 * Arrête la lecture du fichier MIDI
 */
void MidiPlayer::stop() {
  timidity->terminate();
  timidity->waitForFinished();
}
